//
//  JKTitleView.swift
//  JKWeibo
//
//  Created by albert on 16/6/25.
//  Copyright © 2016年 albert. All rights reserved.
//  发文字微博界面的标题

import UIKit
import SnapKit

class JKTitleView: UIView {

    override init(frame: CGRect) {
        super.init(frame: frame)
        setupUI()
    }

    required init?(coder aDecoder: NSCoder) {
        super.init(coder: aDecoder)
        setupUI()
    }
    
    /** 初始化 */
    private func setupUI() {
        addSubview(titleLabel)
        addSubview(subTitleLabel)
        
        titleLabel.snp_makeConstraints { (make) -> Void in
            make.centerX.equalTo(self)
            make.top.equalTo(self)
        }
        
        subTitleLabel.snp_makeConstraints { (make) -> Void in
            make.centerX.equalTo(self)
            make.top.equalTo(titleLabel.snp_bottom)
        }
    }
    
    // MARK: - 懒加载
    /** 主标题 */
    private lazy var titleLabel: UILabel = {
        let lb = UILabel()
        
        lb.text = "发送微博"
        lb.font = UIFont.systemFontOfSize(18)
        
        return lb
    }()
    
    /** 子标题 */
    private lazy var subTitleLabel: UILabel = {
        let lb = UILabel()
        
        lb.text = JKUserAccount.loadUserAccount()?.screen_name
        lb.textColor = UIColor.lightGrayColor()
        lb.font = UIFont.systemFontOfSize(15)
        
        return lb
    }()
}
